<template>
	<el-card class="form-container">
		<el-form :model="couponTemplateDetail" label-width="100px">
			<el-form-item label="可用状态" prop="available">
				<el-radio-group v-model="couponTemplateDetail.available" >
					<el-radio disabled :label="1">可用</el-radio>
					<el-radio disabled :label="2">不可用</el-radio>
				</el-radio-group>
			</el-form-item>
			<el-form-item label="过期状态" prop="expired">
				<el-radio-group v-model="couponTemplateDetail.expired" >
					<el-radio disabled :label="1">已过期</el-radio>
					<el-radio disabled :label="2">未过期</el-radio>
				</el-radio-group>
			</el-form-item>
			<el-form-item label="模版名称" prop="templateName">
				<el-input v-model="couponTemplateDetail.templateName" disabled="disabled"></el-input>
			</el-form-item>
			<el-form-item label="模版logo" prop="templateLogo">
				<el-input v-model="couponTemplateDetail.templateLogo" disabled="disabled"></el-input>
			</el-form-item>
			<el-form-item label="模版介绍" prop="templateIntro">
				<el-input v-model="couponTemplateDetail.templateIntro" disabled="disabled"></el-input>
			</el-form-item>
			<el-form-item label="优惠券分类" prop="templateCategory">
				<el-input v-model="couponTemplateDetail.templateCategory" readonly></el-input>
			</el-form-item>
			<el-form-item label="优惠券数量" prop="couponCount">
				<el-input v-model="couponTemplateDetail.couponCount" disabled="disabled"></el-input>
			</el-form-item>
			<el-form-item label="创建时间" prop="createTime">
				<el-input v-model="couponTemplateDetail.createTime" disabled="disabled"></el-input>
			</el-form-item>
			<el-form-item label="关键词" prop="templateKey">
				<el-input v-model="couponTemplateDetail.templateKey" disabled="disabled"></el-input>
			</el-form-item>
			<el-form-item label="用途" prop="target">
				<el-radio-group v-model="couponTemplateDetail.target" >
					<el-radio disabled :label="1">单个领取</el-radio>
					<el-radio disabled :label="2">批量分发</el-radio>
				</el-radio-group>
				<el-input v-model="couponTemplateDetail.target" disabled="disabled"></el-input>
			</el-form-item>
			<el-form-item label="优惠券规则.用JSON存储" prop="rule">
				<el-input v-model="couponTemplateDetail.rule" disabled="disabled"></el-input>
			</el-form-item>
			<el-form-item label="产品线" prop="productLine">
				<el-input v-model="couponTemplateDetail.productLine" disabled="disabled"></el-input>
			</el-form-item>
			<el-form-item>
				<el-button @click="close">关闭</el-button>
			</el-form-item>
		</el-form>
	</el-card>
</template>

<script>
	import { findCouponTemplateDetail } from '@/api/activity/couponTemplate'
	export default {
		name: 'view-couponTemplate',
		data() {
			return {
				couponTemplateDetail: {}
			}
		},
		created() {
			this.view(this.$route.query.id)
		},
		methods: {
			view(val) {
				findCouponTemplateDetail(val).then(res => {
					console.log('查询返回结果', res)
					this.couponTemplateDetail = res.data.responseData
				})
			},
			close() {
				this.$router.go(-1)
			}
		}
	}
</script>

<style>
</style>
